import axios from "axios"
//查询全部
export async function getAllTags(page, pageSize) {
    let res = await axios.get("/api/tags", {
        params: {
            current: page,//当前页
            pageSize,//每页显示条数
        }
    });
    return res.data;
}
//删除
export async function deleteTags(_id) {
    let res = await axios.delete("/api/tags/" + _id);
    // console.log(res);
    return res;
}

//新增
export async function addTags(name, number) {
    console.log(name, number);
    let res = await axios.post("/api/tags", {
        name,
        number
    })
    console.log(res);
    return res
}
//修改
export async function editTags(_id,name,number) {
    let res = await axios.put("/api/tags/" + _id,{
        name,
        number
    })
    return res
}